<?php
class Qr extends Base_Controller {
	
	public function __construct() {
		parent::__construct();
	}
	
	public function urlencode() {
		$url =   rawurldecode( $this->getQuery('url') );//二维码地址
		$errorCorrectionLevel = 0; //容错级别
		$matrixPointSize = 3; //生成图片大小
		if( !isTrustedDomain( $url ) ){
			$code = ErrorCode::PARMA_ERROR;
			return $this->output($code, ErrorCode::getErrMsg($code));
		}
		//生成二维码图片
		QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize, 2);
	}
	
}